package ink.ykb.redisLockDemo.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.i18n.LocaleContextHolder;

@Configuration
public class MessageUtil {
	
	@Autowired
	private MessageSource messageSource;
	
	
	public String getMessage(String code,Object... args) {
		return messageSource.getMessage(code, args, LocaleContextHolder.getLocale());
	}

}
